from tools.my_methods import *


class Solution:
    def wiggleMaxLength(self, nums: List[int]) -> int:
        dp = [[1, 1]]
        for i in range(1, len(nums)):
            data = [0, 0]
            for j in range(i):
                if nums[j] > nums[i]:
                    data[1] = max(data[1], dp[j][0] + 1)
                elif nums[j] < nums[i]:
                    data[0] = max(data[0], dp[j][1] + 1)
            dp.append(data)
        ans = 0
        for i in range(len(nums)):
            ans = max(ans, dp[i][0])
            ans = max(ans, dp[i][1])
        return ans


questions = [
    ()
]
